/*
* jlb
*/
package com.jlb.setting.ctrl;

import com.alibaba.fastjson.JSONObject;
import com.jlb.core.entity.BeanRet;
import com.jlb.core.tools.redis.RedisUtils;
import com.jlb.setting.entity.Setting;
import com.jlb.setting.service.SettingSV;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 设置 控制器
 *
 * @author jlb
 */
@RestController
@RequestMapping("/app/setting")
@Slf4j
@Api(value = "设置控制器", description = "设置控制器")
public class AppSettingCtrl {

    @Resource
    protected RedisUtils redisUtils;

    @Resource
    private SettingSV settingSV;

    /**
     * 查询首页描述
     *
     * @return BeanRet
     */
    @ApiOperation(value = "查询首页描述", notes = "查询首页描述")
    @GetMapping(value = "/load")
    @ResponseBody
    public BeanRet load() {
        String description = settingSV.loadByK(Setting.Key.App_First_Page_Description.name()).getV();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("description", description);
        return BeanRet.create(true, "查询成功", jsonObject);
    }


}
